package com.managedBean;

import javax.faces.context.FacesContext;
import javax.faces.event.AbortProcessingException;
import javax.faces.event.ActionEvent;
import javax.faces.event.ActionListener;

import com.utils.JsfUtils;

public class NavigationActionListener implements ActionListener {

	@Override
	public void processAction(ActionEvent arg0) throws AbortProcessingException {
		String id = (String) FacesContext.getCurrentInstance()
				.getExternalContext().getSessionMap().get("id");
		System.out.println("Product id=" + id);
		ItemsManagedBean bean = (ItemsManagedBean) JsfUtils
				.getBeanInstanceFromFacesContext("itemsManagedBean");
		bean.setMenuId(id);
		bean.populateItems();

	}

}
